package com.sxhalo.fsms.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sxhalo.fsms.domain.DeviceAlarmRecord;
import com.sxhalo.fsms.mapper.DeviceAlarmRecordMapper;
import com.sxhalo.fsms.service.IDeviceAlarmRecordService;

@Service
public class DeviceAlarmRecordServiceImpl implements IDeviceAlarmRecordService {

	@Autowired
	private DeviceAlarmRecordMapper mapper;
	
	@Override
	public Integer insertSelective(DeviceAlarmRecord record) {
		return mapper.insertSelective(record);
	}

	@Override
	public Integer updateByPrimaryKeySelective(DeviceAlarmRecord record) {
		return mapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public Integer deleteByPrimaryKey(Object key) {
		// TODO Auto-generated method stub
		return mapper.deleteByPrimaryKey(Integer.parseInt(key.toString()));
	}

	@Override
	public DeviceAlarmRecord selectByPrimaryKey(Object key) {
		return mapper.selectByPrimaryKey(Integer.parseInt(key.toString()));
	}

	@Override
	public List<DeviceAlarmRecord> findWhereList(String where, String order) {

		return mapper.findWhereList( where, order);
	}

	@Override
	public Integer getCount(String where) {
		// TODO Auto-generated method stub
		return mapper.getCount(where);
	}

	@Override
	public List<DeviceAlarmRecord> findPagerList(Integer start, Integer length, String where, String order) {
		// TODO Auto-generated method stub
		return mapper.findPagerList(start, length, where, order);
	}

	@Override
	public List<Map<String, Integer>> GetalarmTrendStatistics(Integer type) {
		return mapper.GetalarmTrendStatistics(type);
	}

	@Override
	public Map<String, Integer> getAramNumStatistics() {
		return mapper.getAramNumStatistics();
	}

	@Override
	public List<Map<String,Integer>> getAramTypeNum(String where) {

		return mapper.getAramTypeNum(where);
	}

	@Override
	public List<Map<String, Object>> getAramTypeNumByArea(String time) {
		return mapper.getAramTypeNumByArea(time);
	}

	@Override
	public int getSearchCount(String where) {
		return mapper.getSearchCount(where);
	}

	@Override
	public int foreachInsert(List<DeviceAlarmRecord> list) {
		return mapper.batchInsert(list);
	}

	@Override
	public List<Map<String,Integer>> getDeviceRunstateCount(Integer areaId) {
		return mapper.getDeviceRunstateCount(areaId);
	}

	@Override
	public int batchUpdateByWhere(DeviceAlarmRecord record, String where) {
		return mapper.batchUpdateByWhere(record,where);
	}

	@Override
	public void maintenanceIntervalAram() {
		 //mapper.maintenanceIntervalAram();
	}

	@Override
	public int deleteByWhere(String where) {
		return mapper.deleteByWhere(where);
	}
}
